# -*- coding:utf-8 -*-

__author__ = 'Hillsdong'

import sys
from PIL import Image
from PIL import ImageEnhance

fileIn  = sys.argv[1]
fileOut = sys.argv[2]

img = Image.open(fileIn)
img = img.convert('RGB')
pixdata = img.load()
w, h = img.size
for y in range(h):
    for x in range(w):
        r,g,b = pixdata[x,y]
        if(g<b or r<g or r==b==g==255):
            pixdata[x,y] = (255,255,255)
        else:
            pixdata[x,y] = (0,0,0)
enh = ImageEnhance.Contrast(img)
img = enh.enhance(1.3)
img.save(fileOut)






